<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        margin: 20px !important;
      }

      .button {
        width: 60px;
        height: 26px;
        border-radius: 20px;
        padding: 2px;
        background-color: #ddd;
      }

      .button::after {
        content: "";
        display: inline-block;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background-color: white;
        margin: 2px;
      }

      input[type="checkbox"] {
        display: none;
      }

      input[type="checkbox"]:checked + .button {
        background-color: rgb(119, 218, 218);
      }

      input[type="checkbox"]:checked + .button::after {
        transform: translateX(30px);
      }
    </style>
  </head>
  <body>
    <div>
      <label for="on-off">
        <input type="checkbox" id="on-off" />
        <div class="button"></div>
      </label>
      <br />
      <label for="on-off2">
        <input type="checkbox" id="on-off2" checked />
        <div class="button"></div>
      </label>
    </div>
  </body>
</html>
